#!/usr/bin/php
<?php

### the json encoding in mootools 1.1 is broken. Some fixes can be applied. 
### This is the test file 

#### broken newline escaping and the fix for it
$jsonstring = '{"subject":"aa","text":"aaa' ."\n" . 'bbb"}';
$jsonstring = preg_replace( '/\n/', '\n', $jsonstring );

echo "Jsonstring: $jsonstring\n";

$json = json_decode( $jsonstring );

var_dump( $json );

?>